feat(api): add spec.volumes to Workspace for mounting additional volumes#921
Closed
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
Closed
feat(api): add spec.volumes to Workspace for mounting additional volumes#921knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
Conversation
c85a39a to
9ac4b87
Compare
Allow users to mount PVCs, ConfigMaps, Secrets, or EmptyDirs into the agent container via workspace.spec.volumes. This enables use cases like pre-populated dependency caches, shared datasets, and model weights without requiring setup containers. User-defined volumes are supplementary — the workspace EmptyDir is unchanged and the repo is always freshly cloned for isolation. fix: test using regex rather than :latest Part of kelos-dev#774
806eca7 to
9021205
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds a new optional
spec.volumesfield to the Workspace CRD, allowing users to mount additional volumes (PVCs, ConfigMaps, Secrets, EmptyDirs) into the agent container.This enables use cases like:
node_modulesor other dependency cachesUser-defined volumes are supplementary — the workspace EmptyDir is unchanged and the repo is always freshly cloned for isolation.
Changes:
api/v1alpha1/workspace_types.go: NewWorkspaceVolumetype andVolumesfield onWorkspaceSpecinternal/controller/job_builder.go: Appends user volumes to pod spec and mounts them into the agent containerinternal/controller/job_builder_test.go: 4 new tests (single PVC, multiple volumes, volumes + plugins, empty volumes backward compat)examples/12-workspace-with-volumes/: Example workspace with a PVC volumemake updateWhich issue(s) this PR is related to:
Part of #774
This is the first of two PRs for #774. The second PR will add
spec.setup(init containers) which will also receive these volume mounts.Special notes for your reviewer:
WorkspaceVolume.Sourceuses the Kubernetes-nativecorev1.VolumeSourcetype directly, so no custom volume abstraction is needed. Restricting volume source types (e.g. disallowinghostPath) is left to cluster admission policy, consistent with how most operators handle this.Does this PR introduce a user-facing change?
Summary by cubic
Adds an optional
spec.volumesto theWorkspaceCRD so users can mount extra volumes (PVC, ConfigMap, Secret,EmptyDir) into the agent container. The default workspaceEmptyDirand fresh clone remain unchanged; part of #774.New Features
WorkspaceVolumeandspec.volumesusingcorev1.VolumeSource; enforce unique names and reserve "workspace" and "kelos-plugin".examples/12-workspace-with-volumes/andexamples/15-workspace-with-setup/.Bug Fixes
:latestimage refs using a regex to avoid false positives from CRD descriptions.Written for commit 9021205. Summary will update on new commits.